// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT
// IT'S ALL JUST JUNK FOR OUR DOCS!
// ++++++++++++++++++++++++++++++++++++++++++

!function ($) {

  $(function(){

    // Disable certain links in docs
    $('a[href^=#], .disabled a').click(function (e) {
      e.preventDefault()
    })

    $('#btnLogout').click(function (e) {
      //alert($(this).attr('href'));
      // alert(parent.location.href);
      parent.location.href=$(this).attr('href');
      e.preventDefault()
    })

    // fix sub nav on scroll
    var $win = $(window)
      , $nav = $('.subnav')
      , navTop = $('.subnav').length && $('.subnav').offset().top - 40
      , isFixed = 0

    processScroll()

    $win.on('scroll', processScroll)

    function processScroll() {
      var i, scrollTop = $win.scrollTop()
      if (scrollTop >= navTop && !isFixed) {
        isFixed = 1
        $nav.addClass('subnav-fixed')
      } else if (scrollTop <= navTop && isFixed) {
        isFixed = 0
        $nav.removeClass('subnav-fixed')
      }
    }

    // tooltip
    $('#main').tooltip({
      selector: "a[rel=tooltip], li[rel=tooltip]"
    })


})

}(window.jQuery)